import React, { useEffect, useState } from 'react'
import request from "../../api/request";
import { Space } from 'antd-mobile';
import { useNavigate } from 'react-router-dom';

function Chelist() {
    const navigate=useNavigate();
    const [list,setList]=useState([]);
    const getList=async()=>{
        const res=await request.get('/city')
        console.log("res...",res.data);
        setList(res.data);
    }
    useEffect(()=>{
        getList()
    },[])
  return (
    <div>
      <div style={{marginTop:"10px"}}>
        <ul style={{lineHeight:"50px", marginLeft:"10px"}} onClick={()=>navigate('/list')}>
            <li>北京</li>
            <li>上海</li>
            <li>广州</li>
            <li>深圳</li>
            <li>南京</li>
            <li>武汉</li>
            <li>杭州</li>
            <li>西安</li>
            <li>郑州</li>
            <li>成都</li>
            <li>长沙</li>
        </ul>
      </div>
    </div>
  )
}

export default Chelist
